package com.rem.se.test2;

/*
public class MyService {
    public static int getTotal() {
        CompletableFuture<Integer> futureA = CompletableFuture.supplyAsync(() -> AService.get());
        CompletableFuture<Integer> futureB = CompletableFuture.supplyAsync(() -> BService.get());
        CompletableFuture<Integer> futureC = CompletableFuture.supplyAsync(() -> CService.get());

        //等待三个接口调用完成
        CompletableFuture<Void> allFutures = CompletableFuture.allOf(futureA, futureB, futureC);
        allFutures.join();

        int total = 0;
        synchronized (MyService.class) {
            total += futureA.join();
            total += futureB.join();
            total += futureC.join();
        }
        return total;
    }
}*/
